package com.jcl.recruit.resume.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.resume.mapper.ResumeSelfEvaluationMapper;
import com.jcl.recruit.resume.model.ResumeSelfEvaluation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Component
public class ResumeSelfEvaluationDao implements ResumeSelfEvaluationMapper {

    @Autowired
    ResumeSelfEvaluationMapper resumeSelfEvaluationMapper;

    @Override
    public List<ResumeSelfEvaluation> findListByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumeSelfEvaluationMapper.findListByResumeIds(corpCode, resumeIds);
    }

    @Override
    public Map<String, Object> findOneMap(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumeSelfEvaluationMapper.findOneMap(corpCode, resumeId);
    }

    @Override
    public ResumeSelfEvaluation findOne(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumeSelfEvaluationMapper.findOne(corpCode, resumeId);
    }

    @Override
    public int add(ResumeSelfEvaluation entity) {
        DatabaseContext.setCurrentContext();
        return resumeSelfEvaluationMapper.add(entity);
    }

    @Override
    public int batchDeleteByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumeSelfEvaluationMapper.batchDeleteByResumeIds(corpCode, resumeIds);
    }
}
